using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ICSharpCode.NRefactory.Ast;

namespace AstHelpers.Test
{
	[TestClass]
	public class AstHelpersTest
	{
		[TestMethod]
		public void HasSameVisibilityTest()
		{
			AssertHasSameVisibility(Modifiers.Public, Modifiers.Public);
			AssertHasSameVisibility(Modifiers.Public | Modifiers.Abstract, Modifiers.Public);
		}

		[TestMethod]
		public void IsPublicVisibilityTest()
		{
			Assert.IsTrue(Modifiers.Public.IsPublic());
			Assert.IsFalse(Modifiers.Private.IsPublic());
			Assert.IsTrue((Modifiers.Public | Modifiers.Abstract).IsPublic());
		}

		public void AssertHasSameVisibility(Modifiers one, Modifiers two)
		{
			Assert.IsTrue(one.HasSameVisibility(two));
		}

		public void AssertHasNotSameVisibility(Modifiers one, Modifiers two)
		{
			Assert.IsFalse(one.HasSameVisibility(two));
		}
	}
}
